Xbasic
SQL::ResultSetDataIsNull Method
Syntax
Result as L = DataIsNull(Column as N | Column as C)
Arguments
- ColumnNumeric Character
The column index or column name.
Returns
- ResultLogical
.T. = The data is NULL. .F. = The data is not NULL.
Description
Determine whether a given element is Null.
Discussion
The DataIsNull() method determines whether a given element in a SQL::ResultSet is Null.
Example
dim conn as SQL::Connection
dim args as SQL::Arguments
dim sql as C
sql = "select * from customers where country = :country"
args.set("country","Spain")
if .not. conn.open("::Name::AADemo-Northwind")
ui_msg_box("Error", conn.CallResult.text)
end
end if
if .not. conn.execute(sql,args)
ui_msg_box("Error", conn.CallResult.text)
conn.close()
end
end if
dim list as C = ""
while conn.ResultSet.nextRow()
if .not. conn.ResultSet.DataIsNull(4) then
list = list + conn.ResultSet.Data(4) + crlf()
end if
end while
conn.close()
ui_msg_box("SQL::ResultSet DataIsNull()","Column 4 Values: " + crlf(2) + list)